<%
	var is_subscribed = '<i class="icon-ok hide"></i>';
    var subscribe_class = 'js-list-subscribe';
	var subscribe = subscribers.findWhere({
		 user_id: parseInt(authuser.id),
		 is_subscribed: 1
	 });
	 var subscribe_id = '';
	 if (!_.isEmpty(subscribe) && parseInt(subscribe.attributes.is_subscribed) === 1) {
		 is_subscribed = '<i class="icon-ok"></i>';
		 subscribe_class = 'js-list-unsubscribe';
		 subscribe_id = subscribe.attributes.id;
	 }
%>
<li class="text-center">
        <strong><%- i18next.t("List Actions") %></strong>
        <a class="pull-right js-list-action-hover-icon"><i class=" icon-remove"></i></a>
</li>
<li class="divider"></li>
<% if(!_.isUndefined(authuser) && (authuser.role_id == 1 || !_.isEmpty(list.collection.board.acl_links.where({slug: "edit_list",board_user_role_id: parseInt(list.board_user_role_id)})))){ %>
<li class="dropdown js-show-list-color-settings-dropdown">
        <a class="dropdown-toggle js-show-list-color-settings"  href="#" title="<%- i18next.t('Color') %>" data-toggle="dropdown"><%- i18next.t('Color') %></a>
        <ul class="dropdown-menu dropdown-menu-left arrow col-xs-12">
                <li class="col-xs-12 clearfix text-center"> 
                        <div>
                                <span class="col-xs-10"> <strong>Select a color</strong></span>
                                <a class="js-close-popover pull-right" href="#"><i class="icon-remove "></i></a>
                        </div>
                </li>
                <li class="col-xs-12 divider" id="js-list-demo-<%- list.id %>"></li>
                <ul class="list-color-pad list-inline js-list-inline list-color-alignment">
                        <li class="list-inline js-change-color js-list-color-pick navbar-btn cur" data-color="#34495e"><span class="btn btn-default show well-sm" style="background-color:#34495e"></span></li>
                        <li class="list-inline js-change-color js-list-color-pick navbar-btn cur" data-color="#23719f"><span class="btn btn-default show well-sm" style="background-color:#23719f"></span></li>
                        <li class="list-inline js-change-color js-list-color-pick navbar-btn cur" data-color="#5a966e"><span class="btn btn-default show well-sm" style="background-color:#5a966e"></span></li>
                        <li class="list-inline js-change-color js-list-color-pick navbar-btn cur" data-color="#bf4a40"><span class="btn btn-default show well-sm" style="background-color:#bf4a40"></span></li>
                        <li class="list-inline js-change-color js-list-color-pick navbar-btn cur" data-color="#444444"><span class="btn btn-default show well-sm" style="background-color:#444444"></span></li>
                        <li class="list-inline js-change-color js-list-color-pick navbar-btn cur" data-color="#4f4d7e"><span class="btn btn-default show well-sm" style="background-color:#4f4d7e"></span></li>
                        <li class="list-inline js-change-color js-list-color-pick navbar-btn cur" data-color="#2f663c"><span class="btn btn-default show well-sm" style="background-color:#2f663c"></span></li>
                        <li class="list-inline js-change-color js-list-color-pick navbar-btn cur" data-color="#a37e58"><span class="btn btn-default show well-sm" style="background-color:#a37e58"></span></li>
                        <li class="list-inline js-change-color js-list-color-pick navbar-btn cur" data-color="#5f778e"><span class="btn btn-default show well-sm" style="background-color:#5f778e"></span></li>
                        <li class="list-inline js-change-color js-list-color-pick navbar-btn cur" data-color="#0091ff"><span class="btn btn-default show well-sm" style="background-color:#0091ff"></span></li>
                        <li class="list-inline js-change-color js-list-color-pick navbar-btn cur" data-color="#46ba97"><span class="btn btn-default show well-sm" style="background-color:#46ba97"></span></li>
                        <li class="list-inline js-change-color js-list-color-pick navbar-btn cur" data-color="#f47564"><span class="btn btn-default show well-sm" style="background-color:#f47564"></span></li>
                        <li class="list-inline js-change-color js-list-color-pick navbar-btn cur" data-color="#6b6b6b"><span class="btn btn-default show well-sm" style="background-color:#6b6b6b"></span></li>
                        <li class="list-inline js-change-color js-list-color-pick navbar-btn cur" data-color="#7b5cb3"><span class="btn btn-default show well-sm" style="background-color:#7b5cb3"></span></li>
                        <li class="list-inline js-change-color js-list-color-pick navbar-btn cur" data-color="#65ab36"><span class="btn btn-default show well-sm" style="background-color:#65ab36"></span></li>
                        <li class="list-inline js-change-color js-list-color-pick navbar-btn cur" data-color="#bd6f32"><span class="btn btn-default show well-sm" style="background-color:#bd6f32"></span></li>
                        <li class="list-inline js-change-color js-list-color-pick navbar-btn cur" data-color="#819da2"><span class="btn btn-default show well-sm" style="background-color:#819da2"></span></li>
                        <li class="list-inline js-change-color js-list-color-pick navbar-btn cur" data-color="#47b7cd"><span class="btn btn-default show well-sm" style="background-color:#47b7cd"></span></li>
                        <li class="list-inline js-change-color js-list-color-pick navbar-btn cur" data-color="#95d9ad"><span class="btn btn-default show well-sm" style="background-color:#95d9ad"></span></li>
                        <li class="list-inline js-change-color js-list-color-pick navbar-btn cur" data-color="#f7b09c"><span class="btn btn-default show well-sm" style="background-color:#f7b09c"></span></li>
                        <li class="list-inline js-change-color js-list-color-pick navbar-btn cur" data-color="#999999"><span class="btn btn-default show well-sm" style="background-color:#999999"></span></li>
                        <li class="list-inline js-change-color js-list-color-pick navbar-btn cur" data-color="#baa1e6"><span class="btn btn-default show well-sm" style="background-color:#baa1e6"></span></li>
                        <li class="list-inline js-change-color js-list-color-pick navbar-btn cur" data-color="#9dbb1d"><span class="btn btn-default show well-sm" style="background-color:#9dbb1d"></span></li>
                        <li class="list-inline js-change-color js-list-color-pick navbar-btn cur" data-color="#ffce54"><span class="btn btn-default show well-sm" style="background-color:#ffce54"></span></li>
                        <li class="list-inline js-change-color js-list-color-pick navbar-btn cur" data-color="#b3bec1"><span class="btn btn-default show well-sm" style="background-color:#b3bec1"></span></li>
                        <li class="list-inline js-change-color js-list-color-pick navbar-btn cur" data-color="#bee5f3"><span class="btn btn-default show well-sm" style="background-color:#bee5f3"></span></li>
                        <li class="list-inline js-change-color js-list-color-pick navbar-btn cur" data-color="#caefd2"><span class="btn btn-default show well-sm" style="background-color:#caefd2"></span></li>
                        <li class="list-inline js-change-color js-list-color-pick navbar-btn cur" data-color="#f7d2c8"><span class="btn btn-default show well-sm" style="background-color:#f7d2c8"></span></li>
                        <li class="list-inline js-change-color js-list-color-pick navbar-btn cur" data-color="#d5d5d5"><span class="btn btn-default show well-sm" style="background-color:#d5d5d5"></span></li>
                        <li class="list-inline js-change-color js-list-color-pick navbar-btn cur" data-color="#dbcff1"><span class="btn btn-default show well-sm" style="background-color:#dbcff1"></span></li>
                        <li class="list-inline js-change-color js-list-color-pick navbar-btn cur" data-color="#ccdc87"><span class="btn btn-default show well-sm" style="background-color:#ccdc87"></span></li>
                        <li class="list-inline js-change-color js-list-color-pick navbar-btn cur" data-color="#f1eabf"><span class="btn btn-default show well-sm" style="background-color:#f1eabf"></span></li>
                        <li class="col-xs-12 divider"><hr></li>
                        <li class="list-inline navbar-btn cur">
                                <label for="js-list-custom-color"><%- i18next.t('Custom color') %></label>
                                <div class="col-xs-8">
                                        <div id="list-custom-colorpicker-<%- list.attributes.id %>" class="input-group">
                                                <input type="text" value="<%- list.attributes.color %>" id="js-list-custom-color" class="form-control input-sm"/>
                                                <span class="input-group-addon"><i class="custom-background-box"></i></span>
                                        </div>
                                </div>
                                <div  class="col-xs-4">
                                        <button type="button" class="btn btn-primary btn-sm js-list-customcolor-card"><%- i18next.t('Save') %></button>
                                </div>
                        </li>
                        <div class="well-sm"></div>
                        <% if(!_.isEmpty(list.attributes.color)){ %>
                                <button type="button" class="btn btn-primary js-remove-list-color"  id="js-remove-list-color-<%- list.id %>">Remove color</button>
                        <% }else{ %>
                                <button type="button" class="hide btn btn-primary js-remove-list-color"  id="js-remove-list-color-<%- list.id %>">Remove color</button>
                        <% } %>
                </ul>
                <div class="well-sm"></div></div>
        </ul>
</li>
<% } %>
<li class="panel-settings" id="js-list-setting-<%- list.attributes.id %>">
</li>
<% if(!_.isUndefined(authuser) && (authuser.role_id == 1 || !_.isEmpty(list.collection.board.acl_links.where({slug: "add_card",board_user_role_id: parseInt(list.board_user_role_id)})))) { %>
	<li><a href="#" title="<%- i18next.t('Add Card') %>" class="js-show-add-card-form"><%- i18next.t("Add Card") %></a></li>
<% } %>	
<% if(!_.isUndefined(authuser) && (authuser.role_id == 1 || !_.isEmpty(list.collection.board.acl_links.where({slug: "add_list",board_user_role_id: parseInt(list.board_user_role_id)}))) && !is_offline_data){ %>
	<li class="js-hide-on-offline">
                <a href="#" title="<%- i18next.t('Copy List') %>" class="js-show-copy-list-form"><%- i18next.t("Copy List") %></a>
        </li>
<% } %>	
<% if(!_.isUndefined(authuser) && (authuser.role_id == 1 || !_.isEmpty(list.collection.board.acl_links.where({slug: "edit_list",board_user_role_id: parseInt(list.board_user_role_id)})))) { %>
	<li>
                <a href="#" title="<%- i18next.t('Move List') %>" class="js-show-move-list-form" data-list-id="<%- list.id %>"><%- i18next.t("Move List") %></a>
        </li>
<% } %>
<% if(!_.isUndefined(authuser) && (authuser.role_id == 1 || (((!_.isEmpty(list.collection.board.acl_links.where({slug: "subscribe_list",board_user_role_id: parseInt(list.board_user_role_id)})) && _.isEmpty(subscribe)) || (!_.isEmpty(list.collection.board.acl_links.where({slug: "unsubscribe_list",board_user_role_id: parseInt(list.board_user_role_id)})) && !_.isEmpty(subscribe)))  || (!_.isEmpty(role_links.where({slug: "subscribe_list"})) && list.collection.board.attributes.board_visibility == 2 && _.isEmpty(subscribe) ) || (!_.isEmpty(role_links.where({slug: "unsubscribe_list"})) && list.collection.board.attributes.board_visibility == 2 && !_.isEmpty(subscribe))))) { %>
	<%
		var subscribe_disabled = '';
		var subscribe_title = i18next.t('Subscribe');
		var subscribed = list.collection.board.board_subscribers.findWhere({
			user_id: parseInt(authuser.id),
			is_subscribed: 1
		});
		if (subscribed) {
			subscribe_disabled = 'disabled';
			subscribe_class = '';
			subscribe_title = i18next.t('Board wise subscription already enabled');
		}
	%>
	<li class="<%= subscribe_disabled %>">
                <a href="javascript:void(0);" title="<%- subscribe_title %>" class="highlight-icon <%= subscribe_class %>" data-list-id="<%- list.id %>" data-subscribe-id="<%- subscribe_id %>">
                        <span class="js-subscribe-text">
                                <%if (!_.isEmpty(subscribe) && parseInt(subscribe.attributes.is_subscribed) === 1) {%>
                                        <%- i18next.t("Subscribed") %>
                                <%}else{%>
                                        <%- i18next.t("Subscribe") %>
                                <% } %>
                        </span> <%= is_subscribed %>
                </a>
        </li>
<% } %>	
<li class="divider"></li>

<li><a href="#" title="<%- i18next.t('Show Attachments') %>" class="js-show-list-modal"><%- i18next.t("Show Attachments") %></a></li>
<li class="divider"></li>
<% if(!_.isUndefined(authuser) && (authuser.role_id == 1 || !_.isEmpty(list.collection.board.acl_links.where({slug: "move_list_cards",board_user_role_id: parseInt(list.board_user_role_id)})))) { %>
	<li><a href="#" title="<%- i18next.t('Move All Cards in This List') %>" class="js-show-move-card-list-form" data-list-id="<%- list.id %>"><%- i18next.t("Move All Cards in This List") %></a></li>
<% } %>
<% if(!_.isUndefined(authuser) && (authuser.role_id == 1 ||  !_.isEmpty(list.collection.board.acl_links.where({slug: "archive_all_cards_in_the_list",board_user_role_id: parseInt(list.board_user_role_id)})))) { %>
	<li><a href="#" title="<%- i18next.t('Archive All Cards in this List') %>" class="js-show-confirm-archive-cards" data-list-id="<%- list.id %>"><%- i18next.t("Archive All Cards in this List") %></a></li>
<% } %>
<li class="divider"></li>
<% if(!_.isUndefined(authuser) && (authuser.role_id == 1 || !_.isEmpty(list.collection.board.acl_links.where({slug: "archive_list",board_user_role_id: parseInt(list.board_user_role_id)})))) { %>
	<li><a href="#" title="<%- i18next.t('Archive This List') %>" class="js-show-confirm-archive-list" data-list-id="<%- list.id %>"><%- i18next.t("Archive This List") %></a></li>
<% } %>
<% if(!_.isUndefined(authuser) && (authuser.role_id == 1 ||  !_.isEmpty(list.collection.board.acl_links.where({slug: "delete_list",board_user_role_id: parseInt(list.board_user_role_id)})))) { %>
<li><a href="#" title="<%- i18next.t('Delete this List') %>" class="js-show-confirm-list-delete" data-list-id="<%- list.id %>"><i class="icon-sm icon-warning-sign icon-type text-primary"></i><%- i18next.t("Delete this List") %></a></li>
<% } %>